package com.lekang.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lekang.common.annotation.Excel;
import com.lekang.common.core.domain.BaseEntity;

/**
 * 任务安排对象 task_arrangement
 *
 * @author ruoyi
 * @date 2025-10-16
 */
public class TaskArrangement extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 老人编号（外键） */
    @Excel(name = "老人编号")
    private Long elderlyId;

    /** 项目名称外键（关联护理项目表） */
    @Excel(name = "项目名称外键")
    private Long projectNameId;

    /** 项目类型（护理计划内/外） */
    @Excel(name = "项目类型")
    private String projectType;

    /** 护理员外键编号（外键，关联sys_user） */
    @Excel(name = "护理员外键编号")
    private Long caregiverId;

    /** 期望服务时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 补充时间格式，支持时分秒
    @Excel(name = "期望服务时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date expectedServiceTime;

    /** 创建人外键（外键，关联sys_user） */
    @Excel(name = "创建人外键")
    private Long creator;

    /** 关联单据 */
    @Excel(name = "关联单据")
    private String relatedOrderNo;

    /** 状态（如：待执行、已完成、已取消等） */
    @Excel(name = "状态")
    private String status;

    /** 取消时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "取消时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date cancelTime;

    /** 取消人（外键，关联sys_user） */
    @Excel(name = "取消人")
    private Long cancelPerson;

    /** 取消原因 */
    @Excel(name = "取消原因")
    private String cancelReason;

    /** 执行人（外键，关联sys_user） */
    @Excel(name = "执行人")
    private Long executor;

    /** 执行时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "执行时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date executionTime;

    /** 执行图片 */
    @Excel(name = "执行图片")
    private String executionImage;

    /** 执行记录 */
    @Excel(name = "执行记录")
    private String executionRecord;

    /** 改期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "改期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date rescheduleTime;

    /** 额外字段1 */
    private String extraField1;

    /** 额外字段2 */
    private String extraField2;


    // ===================== 新增：关联显示字段（多表查询时返回） =====================
    /** 老人姓名（关联elderly表name字段） */
    @Excel(name = "老人姓名")  // 支持导出
    private String elderlyName;

    /** 床位号（关联bed表bed_no字段） */
    @Excel(name = "床位号")
    private String bedNo;

    /** 护理项目名称（关联nursing_item表name字段） */
    @Excel(name = "护理项目名称")
    private String projectName;

    /** 护理员姓名（关联sys_user表nick_name字段） */
    @Excel(name = "护理员姓名")
    private String caregiverName;

    /** 创建人姓名（关联sys_user表nick_name字段） */
    @Excel(name = "创建人")
    private String creatorName;


    // ===================== 新增：搜索条件字段（前端传递，用于多表模糊查询） =====================
    /** 老人姓名（搜索用，模糊匹配） */
    private String searchElderlyName;

    /** 护理项目名称（搜索用，模糊匹配） */
    private String searchProjectName;

    /** 护理员姓名（搜索用，模糊匹配） */
    private String searchCaregiverName;

    /** 期望服务时间-开始（搜索用，时间范围） */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expectedServiceTimeStart;

    /** 期望服务时间-结束（搜索用，时间范围） */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expectedServiceTimeEnd;


    /** 老人性别（关联elderly表gender字段） */
    private String elderlyGender;

    public String getElderlyAvatar() {
        return elderlyAvatar;
    }

    public void setElderlyAvatar(String elderlyAvatar) {
        this.elderlyAvatar = elderlyAvatar;
    }

    private String elderlyAvatar;

    public String getElderlyGender() {
        return elderlyGender;
    }

    public void setElderlyGender(String elderlyGender) {
        this.elderlyGender = elderlyGender;
    }

    public Integer getElderlyAge() {
        return elderlyAge;
    }

    public void setElderlyAge(Integer elderlyAge) {
        this.elderlyAge = elderlyAge;
    }

    public String getNursingLevel() {
        return nursingLevel;
    }

    public void setNursingLevel(String nursingLevel) {
        this.nursingLevel = nursingLevel;
    }

    public String getOrderRemark() {
        return orderRemark;
    }

    public void setOrderRemark(String orderRemark) {
        this.orderRemark = orderRemark;
    }

    public String getExecutorName() {
        return executorName;
    }

    public void setExecutorName(String executorName) {
        this.executorName = executorName;
    }

    public String getCancelerName() {
        return cancelerName;
    }

    public void setCancelerName(String cancelerName) {
        this.cancelerName = cancelerName;
    }

    /** 老人年龄（关联elderly表age字段） */
    private Integer elderlyAge;

    /** 护理等级（关联nursing_level表level_name字段） */
    private String nursingLevel;

    /** 订单备注（关联order_management表remark字段） */
    private String orderRemark;

    /** 执行人姓名（关联sys_user表nick_name字段，对应executor外键） */
    private String executorName;

    /** 取消人姓名（关联sys_user表nick_name字段，对应cancelPerson外键） */
    private String cancelerName;


    // ===================== getter/setter 方法（自动生成，包含新增字段） =====================
    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setElderlyId(Long elderlyId)
    {
        this.elderlyId = elderlyId;
    }

    public Long getElderlyId()
    {
        return elderlyId;
    }

    public void setProjectNameId(Long projectNameId)
    {
        this.projectNameId = projectNameId;
    }

    public Long getProjectNameId()
    {
        return projectNameId;
    }

    public void setProjectType(String projectType)
    {
        this.projectType = projectType;
    }

    public String getProjectType()
    {
        return projectType;
    }

    public void setCaregiverId(Long caregiverId)
    {
        this.caregiverId = caregiverId;
    }

    public Long getCaregiverId()
    {
        return caregiverId;
    }

    public void setExpectedServiceTime(Date expectedServiceTime)
    {
        this.expectedServiceTime = expectedServiceTime;
    }

    public Date getExpectedServiceTime()
    {
        return expectedServiceTime;
    }

    public void setCreator(Long creator)
    {
        this.creator = creator;
    }

    public Long getCreator()
    {
        return creator;
    }

    public void setRelatedOrderNo(String relatedOrderNo)
    {
        this.relatedOrderNo = relatedOrderNo;
    }

    public String getRelatedOrderNo()
    {
        return relatedOrderNo;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setCancelTime(Date cancelTime)
    {
        this.cancelTime = cancelTime;
    }

    public Date getCancelTime()
    {
        return cancelTime;
    }

    public void setCancelPerson(Long cancelPerson)
    {
        this.cancelPerson = cancelPerson;
    }

    public Long getCancelPerson()
    {
        return cancelPerson;
    }

    public void setCancelReason(String cancelReason)
    {
        this.cancelReason = cancelReason;
    }

    public String getCancelReason()
    {
        return cancelReason;
    }

    public void setExecutor(Long executor)
    {
        this.executor = executor;
    }

    public Long getExecutor()
    {
        return executor;
    }

    public void setExecutionTime(Date executionTime)
    {
        this.executionTime = executionTime;
    }

    public Date getExecutionTime()
    {
        return executionTime;
    }

    public void setExecutionImage(String executionImage)
    {
        this.executionImage = executionImage;
    }

    public String getExecutionImage()
    {
        return executionImage;
    }

    public void setExecutionRecord(String executionRecord)
    {
        this.executionRecord = executionRecord;
    }

    public String getExecutionRecord()
    {
        return executionRecord;
    }

    public void setRescheduleTime(Date rescheduleTime)
    {
        this.rescheduleTime = rescheduleTime;
    }

    public Date getRescheduleTime()
    {
        return rescheduleTime;
    }

    public void setExtraField1(String extraField1)
    {
        this.extraField1 = extraField1;
    }

    public String getExtraField1()
    {
        return extraField1;
    }

    public void setExtraField2(String extraField2)
    {
        this.extraField2 = extraField2;
    }

    public String getExtraField2()
    {
        return extraField2;
    }

    // 关联显示字段的getter/setter
    public String getElderlyName() {
        return elderlyName;
    }

    public void setElderlyName(String elderlyName) {
        this.elderlyName = elderlyName;
    }

    public String getBedNo() {
        return bedNo;
    }

    public void setBedNo(String bedNo) {
        this.bedNo = bedNo;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getCaregiverName() {
        return caregiverName;
    }

    public void setCaregiverName(String caregiverName) {
        this.caregiverName = caregiverName;
    }

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    // 搜索条件字段的getter/setter
    public String getSearchElderlyName() {
        return searchElderlyName;
    }

    public void setSearchElderlyName(String searchElderlyName) {
        this.searchElderlyName = searchElderlyName;
    }

    public String getSearchProjectName() {
        return searchProjectName;
    }

    public void setSearchProjectName(String searchProjectName) {
        this.searchProjectName = searchProjectName;
    }

    public String getSearchCaregiverName() {
        return searchCaregiverName;
    }

    public void setSearchCaregiverName(String searchCaregiverName) {
        this.searchCaregiverName = searchCaregiverName;
    }

    public Date getExpectedServiceTimeStart() {
        return expectedServiceTimeStart;
    }

    public void setExpectedServiceTimeStart(Date expectedServiceTimeStart) {
        this.expectedServiceTimeStart = expectedServiceTimeStart;
    }

    public Date getExpectedServiceTimeEnd() {
        return expectedServiceTimeEnd;
    }

    public void setExpectedServiceTimeEnd(Date expectedServiceTimeEnd) {
        this.expectedServiceTimeEnd = expectedServiceTimeEnd;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("elderlyId", getElderlyId())
                .append("elderlyName", getElderlyName())  // 新增显示字段
                .append("bedNo", getBedNo())              // 新增显示字段
                .append("projectNameId", getProjectNameId())
                .append("projectName", getProjectName())  // 新增显示字段
                .append("projectType", getProjectType())
                .append("caregiverId", getCaregiverId())
                .append("caregiverName", getCaregiverName())  // 新增显示字段
                .append("expectedServiceTime", getExpectedServiceTime())
                .append("creator", getCreator())
                .append("creatorName", getCreatorName())  // 新增显示字段
                .append("createTime", getCreateTime())
                .append("relatedOrderNo", getRelatedOrderNo())
                .append("status", getStatus())
                .append("cancelTime", getCancelTime())
                .append("cancelPerson", getCancelPerson())
                .append("cancelReason", getCancelReason())
                .append("executor", getExecutor())
                .append("executionTime", getExecutionTime())
                .append("executionImage", getExecutionImage())
                .append("executionRecord", getExecutionRecord())
                .append("rescheduleTime", getRescheduleTime())
                .append("extraField1", getExtraField1())
                .append("extraField2", getExtraField2())
                .toString();
    }
}